<%@ page import="com.chazz.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<% User user= (User) session.getAttribute("user");%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>地址列表</title>
    <style>
        #container{
            width: 950px;
        }
        #adressTable{
            width: 900px;
            margin: auto;
        }
        #th1{
            width: 500px;
        }
        #th2{
            width: 300px;
        }
        #th0{
            width: 30px;
        }

    </style>
</head>
<body>
    <container id="container">
        <header id="header">
            <h3>我的地址管理-><a id="add"  href="addAdress.jsp">增加</a></h3>
            <input type="hidden" name="uid" id="uid" value="${user.getId()}">
        </header>
        <article id="article">
            <table border="1px" id="adressTable">
                <tr id="table_head"><th id="th0">序号</th><th id="th1">地址</th><th id="th2">管理</th></tr>
            </table>
            <span id="msg"></span>
        </article>
    </container>

<script src="js/jquery-3.5.1.js"></script>
    <script src="js/adress.js"></script>
<script>
    $(document).ready(function () {
        showList();

        $(".a").on("click",function (event) {
            event.preventDefault();
        });

        // $("#add").on("click",function () {
        //     var info=prompt("输入新地址：");
        //     if(info!=null){
        //         $.ajax({
        //             "url":"adress.do",
        //             "type":"get",
        //             "dataType":"json",
        //             "data":{"option":"add","uid":$("#uid").val(),"info":info},
        //             "success":function (result) {
        //                 if(result==true) {
        //                     $("tr").not("#table_head").remove();
        //                     showList();
        //                     alert("增加成功");
        //                 }else{
        //                     alert("添加失败");
        //                 }
        //             }
        //         });
        //     }
        // })

        // $(".del").on("click",function(){
        //     var msg=$(this).parent().prev("td").prev("td").html()
        //    alert(msg);
        //
        // });
    });
</script>
</body>
</html>